package cn.com.blueInfo.bpm.template.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.template.entity.Event;
import cn.com.blueInfo.bpm.template.request.EventDTO;
import cn.com.blueInfo.bpm.template.response.EventVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 事件定义表 对象转换
 * @author suxch
 * @since 2025-08-31 16:23:18
 */
@Mapper(componentModel = "spring")
public interface EventConvert
        extends BaseConvert<Event, EventDTO, EventVO> {

    Event dtoToEntity(EventDTO dto);

    Event dtoToEntity(EventDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "eventType", target = "eventType", qualifiedByName = "enumToDesc")
    EventVO entityToVO(Event entity);

}